/*							*/
/*  Indexed Sequential Access Method			*/
/*  Relational Database Systems, Inc.			*/
/*							*/
/*		Proprietary Data			*/
/*    This document contains proprietary information	*/
/* and trade secrets which are the property of		*/
/* Relational Database Systems, Inc. (RDSI). This	*/
/* document is submitted to recipient in confidence.	*/
/* The information contained herein may not be used,	*/
/* copied or disclosed in whole or in part except as	*/
/* permitted by written agreement signed by an officer	*/
/* of RDSI.						*/
/*							*/

/*
 * machine - implementation parameters
 */

#define ISALLOC			/* dynamic buffer allocation	*/
#define NFILES	    8		/* max number of isam files	*/
#define NOPENS	    8		/* max number of opens allowed	*/
#define NBUFS	    8		/* number of btree node buffers	*/
#define NLOCKS	    64		/* max number of record locks	*/
#define NTREES	    10		/* max b-tree level		*/
#define KEYSIZE	    120		/* max length of a key		*/
#define RECORDSIZE  2048	/* max length of a data record	*/
#define NODESIZE    512		/* btree node size		*/
#define NODESHIFT   9		/* log2(NODESIZE)		*/
#define PATHSIZE    64		/* file pathname length		*/
#define CREATMODE   0664	/* file creation access mode	*/
#define ISMAGIC     0177123u	/* ISAM file magic number	*/

/*
 *  Define Operating System
 *
 *  define one of the following:
 *
 *	ZILOG	- ZEUS for Z8000
 *	UNIX	- UNIX V7 from Bell Labs
 *	AUX	- UNIX emulator on the APOLLO
 *	SYSTEM5	- UNIX SYSTEM V
 *	UNIXBSD - UNIX 4.3 BSD
 *
 */
#ifndef NOMACH	/* lint defines machines */

#define UNIXBSD

#endif
/*
 *  Define Flags Appropriate for particular Operating System
 *
 *	Locking -- must define one of following:
 *		ONIXLOCK    --  use "locking" system call
 *		CREATLOCK   --  use semaphore file together
 *				with ".lok" for record locking
 *		MEMLOCK     --  locking can be done in memory
 *				(means access thru only one process)
 *		NOLOCK      --  single-user, no locking at all
 *
 *	Audit trail:
 *		NOAUDIT     --  no audit trail code
 *
 *	Floating point:
 *		NOFLOAT     --  no float or double types
 *
 *	Casts for C-compiler:
 *		NOCASTS     --  C-compiler has no cast capability
 *
 *	Long multiply:
 *		NOLONGMULT  --  use software long multiply
 *
 *	Index record size:
 *		VARIDXSIZ   --  allow smaller index record sizes
 *				NODESIZE, NODESIZE/2, NODESIZE/4, ..., 128
 *
 *	Dynamic memory allocation:
 *		ISALLOC     --  use malloc for open files and buffers
 */

#ifdef  ZILOG
#define	ONIXLOCK		/* ONIX locking available	*/
#define	NOLONGMULT		/* bad Z8000 long multiply	*/
#endif

#ifdef  UNIX			/* CONVERGENT			*/
/*#define ONIXLOCK*/		/* system call "locking()"	*/
/*#define SU*/			/* no concurrency control	*/
#ifndef ONIXLOCK
#ifdef SU
#define ONIXLOCK
#else
#define	CREATLOCK		/* create a file lock		*/
#endif /* SU */
#endif /* ONIXLOCK */
#endif /* UNIX */

#ifdef UNIXBSD
#define MEMLOCK
#endif

#ifdef  SYSTEM5			/* AT&T 3B2			*/
#define CREATLOCK		/* make .lok file		*/
#define SEMPHLOCK		/* use semop() for lksemphore	*/
#endif

#ifdef  AUX
/*#define SU*/			/* no concurrency control	*/
#ifdef SU
#define ONIXLOCK
#else
#define CREATLOCK		/* make .lok file		*/
#endif
#endif /* AUX */

#ifdef	NOCASTS			/* for C-compiler without casts	*/
#define CASTCP
#define CASTIP
#define CASTIN
#define CASTUN
#define CASTSP
#else
#define CASTCP (char *)		/* char pointer cast		*/
#define CASTIP (int *)		/* int pointer cast		*/
#define CASTIN (int)		/* int cast			*/
#define CASTUN (unsigned)	/* unsigned int cast		*/
#define CASTSP (short *)	/* short pointer cast		*/
#endif

#ifdef TENBITS			/* for BBN Machine		*/
				/* !! be sure to edit isam.h !!	*/
#define BYTEMASK	0x3FF	/* mask for one byte		*/
#define BYTESHFT	10	/* shift for one byte		*/
#else
#define BYTEMASK	0xFF	/* mask for one byte		*/
#define BYTESHFT	8	/* shift for one byte		*/
#endif

#define DATNAME ".dat"		/* extension for data file	*/
#define IDXNAME ".idx"		/* extension for index file	*/
#define LOKNAME ".lok"		/* extension for lock file	*/
#define SEMNAME "/isam/lock"	/* prefix for semaphore file	*/

